// @flow
import React, { Component } from 'react'
import { Button } from 'antd'

type Props = {
  data: Object,
  goToDeviceOverView: Function
}
class LinkToDeviceOverView extends Component {
  props: Props
  goToLink: Function
  constructor (props: Props) {
    super(props)
    this.goToLink = this.goToLink.bind(this)
  }

  goToLink () {
    const name = this.props.data.eventName
    window.open('http://139.198.190.235:81/search?key=' + name)
  }
  render () {
    return (
      <Button
        size='small'
        onClick={this.goToLink}
        >
        解决方案
      </Button>
    )
  }
}

export default LinkToDeviceOverView
